<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <ul id="ul1"></ul>


  <script>
    let ul1 = document.getElementById("ul1")
    //创建文档碎片
    let frag = document.createDocumentFragment()

    for (let i = 0; i < 10000; i++) {
      let li = document.createElement("li")
      frag.appendChild(li)
    }
    ul1.appendChild(frag)


  </script>

</body>

</html>